package com.qingrongby.shop.api.v1;

import com.qingrongby.shop.dto.TokenDTO;
import com.qingrongby.shop.exception.http.NotFoundException;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.HashMap;
import java.util.Map;

/**
 * @CLASSNAME TokenController
 * @DESCRIPTION TODO
 * @AUTHOR hzp
 * @DATE 2020/7/6
 * @VERSION 1.0
 **/
@RequestMapping("token")
@RestController
@Validated
public class TokenController {

    @ResponseBody
    @PostMapping("/getToken")
    public Map<String,String> getToken(@RequestBody @Validated TokenDTO tokenDTO) throws NotFoundException {
        Map<String,String> map=new HashMap<>();
        String token=null;
        switch (tokenDTO.getType()){
            case USER_WX:
                break;
            case USER_EMAIL:
                break;
            default:
                throw new NotFoundException(10003);
        }

        return null;
    }

}
